var layer;
layui.use("layer",function(){
	layer = layui.layer;
}); 
var load;
  

 
function loadData_provider(){
	requestAjax("/SSM/view/provider/getProviderList.htm","get","json",null,function(data){ 
		if(data.success){ 
			var providerlist = data.result;
			for(var i in providerlist){
				var $option=$option_template.clone();
				 $option.text(providerlist[i].proName);
				 $option.attr("value",providerlist[i].id); 
				 $select.append($option);
			} ;
		} 
	})  ;
}



 /**
  * ajax form琛ㄥ崟鎻愪氦
  * @param formId
  * @param url
  * @param type
  * @param dataType
  * @param $success
  */
function requestAjaxForm(formId, url, type, dataType, $success){ 
	$("#"+formId).ajaxForm({
		url:url, 
		type:type,
		dataType:dataType,
		beforeSend:function(){ 
			 alert("ajax成功")
		},
		success:$success,
		error:function(jqxhr){
			alert(jqxhr.status);
		},
		complete:function(){//ajax 
	 	  alert("ajax完成")
		}
	});
}
 


//ajax
function requestAjax(url,type,dataType,params,$success){
	$.ajax({
		url:url,
		type:type,
		dataType:dataType,
		data:params,
		beforeSend:function(){//ajax-
			load = layer.load();
		},
		complete:function(){//ajax-
			layer.close(load);
		},
		success:$success,
		error:function(jqxhr){
			layer.msg(jqxhr.status);
		}
	});
}